import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

import '../components/CategoryTitle.dart';
import '../components/PageWrap.dart';

class RowAndColumnLn extends StatefulWidget {
  const RowAndColumnLn({super.key});

  @override
  State<RowAndColumnLn> createState() => _RowAndColumnLnState();
}

class _RowAndColumnLnState extends State<RowAndColumnLn> {
  @override
  Widget build(BuildContext context) {
    return PageWrap(
      title: "线性布局（Row和Column）",
      children: <Widget>[
        CategoryTitle(text: "Row"),
        Column(
          //测试Row对齐方式，排除Column默认居中对齐的干扰
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text(" hello world "),
                Text(" I am Jack "),
              ],
            ),
            Row(
              mainAxisSize: MainAxisSize.min,
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                Text(" hello world "),
                Text(" I am Jack "),
              ],
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.end,
              textDirection: TextDirection.rtl,
              children: <Widget>[
                Text(" hello world "),
                Text(" I am Jack "),
              ],
            ),
            Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              verticalDirection: VerticalDirection.up,
              children: <Widget>[
                Text(
                  " hello world ",
                  style: TextStyle(fontSize: 30.0),
                ),
                Text(" I am Jack "),
              ],
            ),
          ],
        ),
        SizedBox(
          height: 20.0,
        ),
        CategoryTitle(text: "Column"),
        Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Text("hi"),
            Text("world"),
          ],
        )
      ],
    );
  }
}
